package com.tjetc.dao;

import com.tjetc.entity.ShoppingCart;

import java.time.LocalDateTime;
import java.util.List;

/***
 * 查询购物车数据
 */
public interface ShoppingCartMapper {
    //加入购物车
    int add(ShoppingCart shoppingCart);

    //删除
    int delete(Integer id);

    //查询
    ShoppingCart select(Integer id);

    //修改数量
    int updateNumber(Integer id, Integer increment, LocalDateTime now);

    //批量获取
    List<ShoppingCart> selectByIdList(List<Integer> list);

    //批量删除
    int deleteList(List<Integer> list);

    //用户查询所有
    List<ShoppingCart> selectAll(Integer userId, Integer merchantId);

    //清空购物车
    int deleteAll(Integer userId, Integer merchantId);

    ShoppingCart selectById(int userId, int dishId, int merchantId);
}
